package com.rboat.exam.service.impl;

import java.util.List;
import com.rboat.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rboat.exam.mapper.ExamTestQuestionsMapper;
import com.rboat.exam.domain.ExamTestQuestions;
import com.rboat.exam.service.IExamTestQuestionsService;
import com.rboat.common.core.text.Convert;

/**
 * 试题Service业务层处理
 * 
 * @author rboat
 * @date 2019-09-02
 */
@Service
public class ExamTestQuestionsServiceImpl implements IExamTestQuestionsService 
{
    @Autowired
    private ExamTestQuestionsMapper examTestQuestionsMapper;

    /**
     * 查询试题
     * 
     * @param id 试题ID
     * @return 试题
     */
    @Override
    public ExamTestQuestions selectExamTestQuestionsById(String id)
    {
        return examTestQuestionsMapper.selectExamTestQuestionsById(id);
    }

    /**
     * 查询试题列表
     * 
     * @param examTestQuestions 试题
     * @return 试题
     */
    @Override
    public List<ExamTestQuestions> selectExamTestQuestionsList(ExamTestQuestions examTestQuestions)
    {
        return examTestQuestionsMapper.selectExamTestQuestionsList(examTestQuestions);
    }

    /**
     * 新增试题
     * 
     * @param examTestQuestions 试题
     * @return 结果
     */
    @Override
    public int insertExamTestQuestions(ExamTestQuestions examTestQuestions)
    {
        examTestQuestions.setCreateTime(DateUtils.getNowDate());
        return examTestQuestionsMapper.insertExamTestQuestions(examTestQuestions);
    }

    /**
     * 修改试题
     * 
     * @param examTestQuestions 试题
     * @return 结果
     */
    @Override
    public int updateExamTestQuestions(ExamTestQuestions examTestQuestions)
    {
        examTestQuestions.setUpdateTime(DateUtils.getNowDate());
        return examTestQuestionsMapper.updateExamTestQuestions(examTestQuestions);
    }

    /**
     * 删除试题对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExamTestQuestionsByIds(String ids)
    {
        return examTestQuestionsMapper.deleteExamTestQuestionsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除试题信息
     * 
     * @param id 试题ID
     * @return 结果
     */
    @Override
    public int deleteExamTestQuestionsById(String id)
    {
        return examTestQuestionsMapper.deleteExamTestQuestionsById(id);
    }
}
